<?php
/**
 * CreateTime: 2022/6/8 19:13
 */

namespace App\ServiceChecker\newContract;

use App\Consts\ResponseConsts\ResponseStatusConsts;
use App\Func\ResponseFunc;
use App\Models\NewContract\FulfillmentNodeModel;
use App\ServiceChecker\BasicServiceChecker;
use Illuminate\Http\Exceptions\HttpResponseException;

class FulfillmentNodeLegitimacy extends BasicServiceChecker
{
    public function __construct()
    {
        parent::__construct();

    }

    public function verifyFulfillmentNodeIsExists($fulfillmentNodeId){
       $fnm =  new FulfillmentNodeModel();
       $isExist = $fnm->isExistByCondition([
          'fulfillment_node_id' => $fulfillmentNodeId
       ]);
       if(!$isExist){
           throw new HttpResponseException( ResponseFunc::returnJson(
               'error',
               null,
               '当前履约节点不存在',
               ResponseStatusConsts::OK_200_RESPONSE_STATUS,
           ));
       }
    }
}